package store.pay;

import java.util.HashMap;
import java.util.Map;

import store.pay.icbc.IcbcB2bConfigObject;
import store.pay.icbc.IcbcB2cConfigObject;
import store.util.PayConfig;

/**
 * 配置文件读取类
 */
public class ConfigObjectHelper {

	// 模拟数据
	private static Map<Class, ConfigObject> configs = new HashMap<Class, ConfigObject>();
	
	// 模拟数据 
	static {
		IcbcB2cConfigObject icbcB2co = new IcbcB2cConfigObject();
		icbcB2co.setMerID(PayConfig.MERID);
		icbcB2co.setMerAcct(PayConfig.MERACCT);
		icbcB2co.setPassword(PayConfig.PASSWORD);
		configs.put(IcbcB2cConfigObject.class, icbcB2co);
		
		IcbcB2bConfigObject icbcB2bo = new IcbcB2bConfigObject();
		icbcB2bo.setShop_code("1611EC13401181");
		icbcB2bo.setShop_acc_num("1611002319022123647");
		icbcB2bo.setPayeeAcct("1611002309024596339");
		configs.put(IcbcB2bConfigObject.class, icbcB2bo);
		
	}
	
	public static ConfigObject getConfig(Class clazz) {
		
		//先从模拟数据中读取
		//将从模拟数据读取配置，改成从缓存或持久层获取
		return configs.get(clazz);
	}
	
	
	
}
